home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 May / EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso / earcd / comm / tcp / amircask.lha / askhost.amirx < prev   
Text File  |  1997-02-02  |  2KB  |  83 lines

  1. /* Askhost script for use with AmIRC 1.x */ Version='1.02'/*
  2. // Written by Deryk Robosson 11.18.96
  3. //
  4. // newlook@ameritech.net newlook on #amiga IRC (EfNet)
  5. //
  6. // 3.1.97 Corrected problem with SAY. Reported by SimD
  7. // 15.1.97 Supports showing a user the output
  8. //         Supports passing user nick for input
  9. */
  10. bold=d2c(2)
  11. tempfile="t:Askhost.temp"
  12.  
  13. trace results
  14. options results
  15. parse arg param
  16.  
  17. param=trim(upper(param))
  18. if param="" then do
  19.     Call Version()
  20.     Exit
  21. end
  22.  
  23. if param='VER' then do
  24.     Call Version()
  25.     Exit
  26. end
  27.  
  28. if param='HELP' then do
  29.     Call Help()
  30.     Exit
  31. end
  32.  
  33. if param~="" then do
  34.     parse var param where" "command
  35.     parse var where domain"."whatever
  36.     if whatever="" then do
  37.         'USERHOST 'where
  38.         if result~="RESULT" then parse var result blah"@"host
  39.     end
  40.     else host=where
  41.  
  42.     if command~="" then do
  43.         parse var command command" "user
  44.     end
  45.     else command=""
  46. end
  47.  
  48. ADDRESS COMMAND 'amitcp:bin/Askhost 'host' >T:Askhost.temp'
  49.  
  50. if open(file, tempfile,'R') then do
  51.     do until eof(file)
  52.         line=ReadLn(file)
  53.         select
  54.             when line=' ' then nop
  55.             otherwise
  56.                 select
  57.                     when command="SAY" then 'SAY 'line
  58.                     when command="SHOW" then "RAW NOTICE" user ":"line
  59.                     otherwise
  60.                         if command="" then 'echo 'line
  61.                 end
  62.         end
  63.     end
  64.     close(file)
  65.     ADDRESS COMMAND 'delete >NIL: ' tempfile 'quiet force'
  66. end
  67. Exit
  68.  
  69. Version:
  70. 'echo 'BOLD"Askhost.AMIRX"BOLD" Version "BOLD||VERSION||BOLD
  71. 'echo '"Read the top of Askhost.AMIRX script for history."
  72. 'echo 'BOLD"©1996"BOLD" Deryk Robososn "BOLD"(newlook)"BOLD" - [newlook@ameritech.net]"
  73. 'echo '"Type /<alias> help for command information"
  74. return
  75.  
  76. Help:
  77. 'echo 'BOLD"Askhost.AMIRC"BOLD" Help"
  78. 'echo 'BOLD"SAY - "BOLD"echos output to window"
  79. 'echo 'BOLD"VER - "BOLD"displays script version"
  80. 'echo 'BOLD"SHOW - "BOLD"displays outout to user"
  81. 'echo 'BOLD"HELP - "BOLD"displays this file"
  82. return
  83.